home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
BBS-Archive
/
Comm
/
term-source.lha
/
Extras
/
Source
/
term-Source.lha
/
CapturePanel.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-06-17
|
21KB
|
862 lines
/*
** CapturePanel.c
**
** Editing panel for log file, buffer and capture configuration
**
** Copyright © 1990-1995 by Olaf `Olsen' Barthel
** All Rights Reserved
*/
#include "termGlobal.h"
enum { GAD_LOGACTIONS, GAD_LOGFILE, GAD_SELECT_LOGFILE, GAD_LOGCALLS, GAD_CALL_LOGFILE,GAD_SELECT_CALL_LOGFILE,
GAD_MAX_BUFFER_SIZE,GAD_BUFFER_ENABLED,GAD_BUFFER_PATH,GAD_SELECT_BUFFER_PATH,
GAD_CONNECT_AUTO_CAPTURE, GAD_AUTOCAPTURE_DATE, GAD_CAPTURE_FILTER, GAD_CONVERT_CHARS,
GAD_CAPTURE_PATH, GAD_SELECT_CAPTURE_PATH, GAD_OPEN_BUFFER_WINDOW,
GAD_REMEMBER_WINDOW_POS,GAD_OPEN_BUFFER_SCREEN,GAD_REMEMBER_SCREEN_POS,GAD_SEARCH_HISTORY,
GAD_SCREENMODE,GAD_BUFFERSCREEN_POSITION,GAD_BUFFERWIDTH,GAD_USE, GAD_CANCEL, GAD_DEFAULT,
GAD_PAGER, GAD_PAGEGROUP,
};
STATIC BYTE __regargs
SelectDisplayMode(struct Window *Window,ULONG *CurrentMode,struct Configuration *Config)
{
BYTE Success = FALSE;
if(!Kick30)
{
struct List *ModeList;
LONG Index;
if(ModeList = BuildModeList(&Index,*CurrentMode,NULL))
{
struct LayoutHandle *Handle;
if(Handle = LT_CreateHandleTags(Window -> WScreen,
LH_LocaleHook, &LocaleHook,
TAG_DONE))
{
struct Window *LocalWindow;
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_Type, LISTVIEW_KIND,
LA_LabelID, MSG_V36_0160,
GTLV_Labels, ModeList,
LA_LONG, &Index,
LALV_CursorKey, TRUE,
LALV_Link, NIL_LINK,
LALV_MaxGrowY, 20,
LALV_ResizeY, TRUE,
LA_Lines, 10,
LA_Chars, 40,
LA_CursorKey, TRUE,
TAG_DONE);
LT_EndGroup(Handle);
}
LT_New(Handle,
LA_Type,VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_Type, XBAR_KIND,
LAXB_FullSize, TRUE,
TAG_DONE);
LT_EndGroup(Handle);
}
LT_New(Handle,LA_Type,HORIZONTAL_KIND,
LAGR_SameSize, TRUE,
LAGR_Spread, TRUE,
TAG_DONE);
{
LT_New(Handle,
LA_Type, BUTTON_KIND,
LA_LabelID, MSG_GLOBAL_USE_GAD,
LA_ID, GAD_USE,
LABT_ReturnKey, TRUE,
LABT_ExtraFat, TRUE,
TAG_DONE);
LT_New(Handle,
LA_Type, BUTTON_KIND,
LA_LabelID, MSG_GLOBAL_CANCEL_GAD,
LA_ID, GAD_CANCEL,
LABT_EscKey, TRUE,
LABT_ExtraFat, TRUE,
TAG_DONE);
LT_EndGroup(Handle);
}
LT_EndGroup(Handle);
}
if(LocalWindow = LT_Layout(Handle,LocaleString(MSG_V36_0161),NULL,0,0,IDCMP_CLOSEWINDOW,NULL,
LAWN_HelpHook, &GuideHook,
LAWN_Parent, Window,
WA_DepthGadget, TRUE,
WA_CloseGadget, TRUE,
WA_DragBar, TRUE,
WA_RMBTrap, TRUE,
WA_Activate, TRUE,
TAG_DONE))
{
struct IntuiMessage *Message;
BOOL Done = FALSE;
ULONG MsgClass,
MsgQualifier;
UWORD MsgCode;
struct Gadget *MsgGadget;
LONG i;
struct ModeNode *ModeNode;
do
{
WaitPort(LocalWindow -> UserPort);
while(Message = (struct IntuiMessage *)LT_GetIMsg(Handle))
{
MsgClass = Message -> Class;
MsgCode = Message -> Code;
MsgQualifier = Message -> Qualifier;
MsgGadget = (struct Gadget *)Message -> IAddress;
LT_ReplyIMsg(Message);
if(MsgClass == IDCMP_CLOSEWINDOW)
Done = TRUE;
if(MsgClass == IDCMP_GADGETUP)
{
switch(MsgGadget -> GadgetID)
{
case GAD_USE:
for(ModeNode = (struct ModeNode *)ModeList -> lh_Head, i = 0 ; ModeNode -> VanillaNode . ln_Succ ; ModeNode = (struct ModeNode *)ModeNode -> VanillaNode . ln_Succ, i++)
{
if(Index == i)
{
*CurrentMode = ModeNode -> DisplayID;
break;
}
}
Success = Done = TRUE;
break;
case GAD_CANCEL:
Done = TRUE;
break;
}
}
if(MsgClass == IDCMP_IDCMPUPDATE)
{
for(ModeNode = (struct ModeNode *)ModeList -> lh_Head, i = 0; ModeNode -> VanillaNode . ln_Succ ; ModeNode = (struct ModeNode *)ModeNode -> VanillaNode . ln_Succ, i++)
{
if(Index == i)
{
*CurrentMode = ModeNode -> DisplayID;
Success = Done = TRUE;
LT_PressButton(Handle,GAD_USE);
break;
}
}
}
}
}
while(!Done);
}
LT_DeleteHandle(Handle);
}
DeleteList(ModeList);
}
}
else
{
struct ScreenModeRequester *Request;
struct TagItem DimensionTags[5];
if(Request = (struct ScreenModeRequester *)AllocAslRequestTags(ASL_ScreenModeRequest,
ASLSM_Window, Window,
ASLSM_InitialDisplayID, *CurrentMode,
ASLSM_PrivateIDCMP, TRUE,
TAG_MORE,GetDimensionTags(Window,DimensionTags)))
{
if(AslRequestTags(Request,TAG_DONE))
{
PutDimensionTags(Window,Request -> sm_LeftEdge,Request -> sm_TopEdge,Request -> sm_Width,Request -> sm_Height);
*CurrentMode = Request -> sm_DisplayID;
Success = TRUE;
}
FreeAslRequest(Request);
}
}
return(Success);
}
BYTE __regargs
CapturePanel(struct Configuration *Config,BYTE *Default)
{
STATIC LONG PageTitleID[7] =
{
MSG_V36_0008,
MSG_V36_0009,
MSG_V36_0011,
MSG_V36_0013,
MSG_V36_0014,
MSG_CAPTUREPANEL_SERVICES_TXT,
-1
};
STATIC BYTE InitialPage = 0;
struct LayoutHandle *Handle;
BYTE Cancel = FALSE;
STRPTR PageTitle[7];
LocalizeStringTable(PageTitle,PageTitleID);
SaveConfig(Config,PrivateConfig);
if(Handle = LT_CreateHandleTags(Window -> WScreen,
LH_LocaleHook, &LocaleHook,
LH_ExitFlush, FALSE,
TAG_DONE))
{
struct Window *PanelWindow;
BYTE OpenBufferWindow = Config -> CaptureConfig -> OpenBufferWindow & 0xF,
OpenBufferScreen = Config -> CaptureConfig -> OpenBufferScreen & 0xF;
UBYTE ModeName[DISPLAYNAMELEN + 1];
ULONG DisplayMode;
DisplayMode = Config -> CaptureConfig -> BufferScreenMode;
if(ModeNotAvailable(DisplayMode))
{
if(Config && Config -> ScreenConfig)
DisplayMode = Config -> ScreenConfig -> DisplayMode;
else
DisplayMode = INVALID_ID;
}
if(ModeNotAvailable(DisplayMode))
{
struct Screen *PubScreen = LockPubScreen(NULL);
if(PubScreen)
{
DisplayMode = GetVPModeID(&PubScreen -> ViewPort);
UnlockPubScreen(NULL,PubScreen);
}
else
DisplayMode = DEFAULT_MONITOR_ID | HIRES_KEY;
}
strcpy(ModeName,GetModeName(DisplayMode));
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_Type,VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_Type, CYCLE_KIND,
LA_ID, GAD_PAGER,
LA_LabelID, MSG_XFER_PAGE_TXT,
GTCY_Labels, PageTitle,
LACY_AutoPageID,GAD_PAGEGROUP,
LACY_TabKey, TRUE,
LA_BYTE, &InitialPage,
TAG_DONE);
LT_EndGroup(Handle);
}
LT_New(Handle,
LA_Type, VERTICAL_KIND,
LA_ID, GAD_PAGEGROUP,
LAGR_Frame, TRUE,
LAGR_ActivePage,InitialPage,
TAG_DONE);
{
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_LOG_ACTIONS_GAD,
LA_Type, CHECKBOX_KIND,
LA_ID, GAD_LOGACTIONS,
LA_BYTE, &Config -> CaptureConfig -> LogActions,
TAG_DONE);
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_LOGFILE_GAD,
LA_Type, STRING_KIND,
LA_ID, GAD_LOGFILE,
LA_Chars, 20,
LA_STRPTR, Config -> CaptureConfig -> LogFileName,
LAST_Picker, TRUE,
GTST_MaxChars, MAX_FILENAME_LENGTH - 1,
TAG_DONE);
LT_New(Handle,
LA_Type, XBAR_KIND,
TAG_DONE);
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_LOG_CALLS_GAD,
LA_Type, CHECKBOX_KIND,
LA_ID, GAD_LOGCALLS,
LA_BYTE, &Config -> CaptureConfig -> LogCall,
TAG_DONE);
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_CALL_LOGFILE_GAD,
LA_Type, STRING_KIND,
LA_ID, GAD_CALL_LOGFILE,
LA_STRPTR, Config -> CaptureConfig -> CallLogFileName,
LAST_Picker, TRUE,
GTST_MaxChars, MAX_FILENAME_LENGTH - 1,
TAG_DONE);
LT_EndGroup(Handle);
}
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_BUFFER_ENABLED_GAD,
LA_Type, CHECKBOX_KIND,
LA_ID, GAD_BUFFER_ENABLED,
LA_BYTE, &Config -> CaptureConfig -> BufferEnabled,
TAG_DONE);
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_MAX_BUFFER_SIZE_GAD,
LA_Type, INTEGER_KIND,
LA_ID, GAD_MAX_BUFFER_SIZE,
LA_LONG, &Config -> CaptureConfig -> MaxBufferSize,
LAIN_UseIncrementers, TRUE,
LAIN_Min, 0,
TAG_DONE);
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_BUFFER_PATH_GAD,
LA_Type, STRING_KIND,
LA_ID, GAD_BUFFER_PATH,
LA_STRPTR, Config -> CaptureConfig -> BufferPath,
LAST_Picker, TRUE,
LA_Chars, 20,
GTST_MaxChars, MAX_FILENAME_LENGTH - 1,
TAG_DONE);
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_BUFFER_LINE_WIDTH_GAD,
LA_Type, SliderType,
LA_ID, GAD_BUFFERWIDTH,
LA_UBYTE, &Config -> CaptureConfig -> BufferWidth,
GTSL_Min, 80,
GTSL_Max, BUFFER_LINE_MAX,
GTSL_LevelFormat, "%3ld",
TAG_DONE);
LT_EndGroup(Handle);
}
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_CONNECT_AUTO_CAPTURE_GAD,
LA_Type, CHECKBOX_KIND,
LA_ID, GAD_CONNECT_AUTO_CAPTURE,
LA_BYTE, &Config -> CaptureConfig -> ConnectAutoCapture,
TAG_DONE);
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_CAPTURE_FILTER_ENABLED_GAD,
LA_Type, CHECKBOX_KIND,
LA_ID, GAD_CAPTURE_FILTER,
LA_BYTE, &Config -> CaptureConfig -> CaptureFilterMode,
TAG_DONE);
LT_New(Handle,
LA_LabelID, MSG_CONVERT_CHARACTERS_GAD,
LA_Type, CHECKBOX_KIND,
LA_BYTE, &Config -> CaptureConfig -> ConvertChars,
GA_Disabled, !Config -> CaptureConfig -> CaptureFilterMode,
LA_ID, GAD_CONVERT_CHARS,
TAG_DONE);
LT_EndGroup(Handle);
}
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_CREATION_DATE_GAD,
LA_Type, CYCLE_KIND,
LA_ID, GAD_AUTOCAPTURE_DATE,
LA_BYTE, &Config -> CaptureConfig -> AutoCaptureDate,
LACY_FirstLabel,MSG_CAPTUREPANEL_APPEND_DATE_TXT,
LACY_LastLabel, MSG_CAPTUREPANEL_WRITE_DATE_TO_FILE_TXT,
TAG_DONE);
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_CAPTURE_PATH_GAD,
LA_Type, STRING_KIND,
LA_ID, GAD_CAPTURE_PATH,
LA_Chars, 20,
LA_STRPTR, Config -> CaptureConfig -> CapturePath,
LAST_Picker, TRUE,
GTST_MaxChars, MAX_FILENAME_LENGTH - 1,
LA_ExtraSpace, TRUE,
TAG_DONE);
LT_EndGroup(Handle);
}
LT_EndGroup(Handle);
}
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_OPEN_BUFFER_WINDOW_GAD,
LA_Type, MX_KIND,
LA_ID, GAD_OPEN_BUFFER_WINDOW,
LA_BYTE, &OpenBufferWindow,
LAMX_FirstLabel,MSG_CAPTUREPANEL_TOP_TXT,
LAMX_LastLabel, MSG_CAPTUREPANEL_END_TXT,
TAG_DONE);
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_REMEMBER_BUFFER_WINDOW_GAD,
LA_Type, CHECKBOX_KIND,
LA_ID, GAD_REMEMBER_WINDOW_POS,
LA_BYTE, &Config -> CaptureConfig -> RememberBufferWindow,
LA_ExtraSpace, TRUE,
TAG_DONE);
LT_EndGroup(Handle);
}
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_OPEN_BUFFER_SCREEN_GAD,
LA_Type, MX_KIND,
LA_ID, GAD_OPEN_BUFFER_SCREEN,
LA_BYTE, &OpenBufferScreen,
LAMX_FirstLabel,MSG_CAPTUREPANEL_TOP_TXT,
LAMX_LastLabel, MSG_CAPTUREPANEL_END_TXT,
TAG_DONE);
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_REMEMBER_BUFFER_SCREEN_GAD,
LA_Type, CHECKBOX_KIND,
LA_ID, GAD_REMEMBER_SCREEN_POS,
LA_BYTE, &Config -> CaptureConfig -> RememberBufferScreen,
LA_ExtraSpace, TRUE,
TAG_DONE);
LT_New(Handle,
LA_Type, XBAR_KIND,
TAG_DONE);
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_BUFFER_SCREEN_POSITION_GAD,
LA_Type, MX_KIND,
LA_ID, GAD_BUFFERSCREEN_POSITION,
LA_BYTE, &Config -> CaptureConfig -> BufferScreenPosition,
LAMX_FirstLabel,MSG_CAPTUREPANEL_LEFT_TXT,
LAMX_LastLabel, MSG_CAPTUREPANEL_RIGHT_TXT,
TAG_DONE);
LT_New(Handle,
LA_Type, XBAR_KIND,
TAG_DONE);
LT_EndGroup(Handle);
}
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,
LA_Type, TEXT_KIND,
LA_LabelID, MSG_SCREENPANEL_CURRENT_DISPLAY_MODE_GAD,
LA_Chars, 20,
LA_ID, GAD_SCREENMODE,
GTTX_Text, ModeName,
GTTX_Border, TRUE,
LATX_Picker, TRUE,
LATX_LockSize, TRUE,
TAG_DONE);
LT_EndGroup(Handle);
}
LT_EndGroup(Handle);
}
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
if(Config -> CaptureConfig -> SearchHistory < 1)
Config -> CaptureConfig -> SearchHistory = 10;
LT_New(Handle,
LA_LabelID, MSG_CAPTUREPANEL_SEARCH_HISTORY_GAD,
LA_Type, INTEGER_KIND,
LA_ID, GAD_SEARCH_HISTORY,
LA_Chars, 8,
LAIN_UseIncrementers, TRUE,
LAIN_Min, 1,
LAIN_Max, 255,
LA_BYTE, &Config -> CaptureConfig -> SearchHistory,
TAG_DONE);
LT_EndGroup(Handle);
}
LT_EndGroup(Handle);
}
LT_New(Handle,
LA_Type, VERTICAL_KIND,
TAG_DONE);
{
LT_New(Handle,LA_Type,XBAR_KIND,LAXB_FullSize,TRUE,TAG_DONE);
LT_EndGroup(Handle);
}
LT_New(Handle,LA_Type,HORIZONTAL_KIND,
LAGR_SameSize, TRUE,
LAGR_Spread, TRUE,
TAG_DONE);
{
LT_New(Handle,
LA_Type, BUTTON_KIND,
LA_LabelID, MSG_GLOBAL_USE_GAD,
LA_ID, GAD_USE,
LABT_ReturnKey, TRUE,
LABT_ExtraFat, TRUE,
TAG_DONE);
if(Default)
{
LT_New(Handle,
LA_Type, BUTTON_KIND,
LA_LabelID, MSG_GLOBAL_DEFAULT_GAD,
LA_ID, GAD_DEFAULT,
LABT_ExtraFat, TRUE,
TAG_DONE);
}
LT_New(Handle,
LA_Type, BUTTON_KIND,
LA_LabelID, MSG_GLOBAL_CANCEL_GAD,
LA_ID, GAD_CANCEL,
LABT_EscKey, TRUE,
LABT_ExtraFat, TRUE,
TAG_DONE);
LT_EndGroup(Handle);
}
LT_EndGroup(Handle);
}
if(PanelWindow = LT_Layout(Handle,LocaleString(MSG_CAPTUREPANEL_CAPTURE_SETTINGS_TXT),NULL,0,0,IDCMP_CLOSEWINDOW,0,
LAWN_HelpHook, &GuideHook,
LAWN_Parent, Window,
WA_DepthGadget, TRUE,
WA_CloseGadget, TRUE,
WA_DragBar, TRUE,
WA_RMBTrap, TRUE,
WA_Activate, TRUE,
TAG_DONE))
{
struct IntuiMessage *Message;
BOOLEAN Done = FALSE;
ULONG MsgClass,
MsgQualifier;
UWORD MsgCode;
struct Gadget *MsgGadget;
UBYTE DummyBuffer[MAX_FILENAME_LENGTH],
*DummyChar;
struct FileRequester *FileRequest;
GuideContext(CONTEXT_CAPTURE);
PushWindow(PanelWindow);
LT_ShowWindow(Handle,TRUE);
do
{
if(Wait(PORTMASK(PanelWindow -> UserPort) | SIG_BREAK) & SIG_BREAK)
{
SaveConfig(PrivateConfig,Config);
break;
}
while(Message = LT_GetIMsg(Handle))
{
MsgClass = Message -> Class;
MsgQualifier = Message -> Qualifier;
MsgCode = Message -> Code;
MsgGadget = (struct Gadget *)Message -> IAddress;
LT_ReplyIMsg(Message);
if(MsgClass == IDCMP_CLOSEWINDOW)
{
SaveConfig(PrivateConfig,Config);
Done = TRUE;
}
if(MsgClass == IDCMP_GADGETUP)
{
switch(MsgGadget -> GadgetID)
{
case GAD_CAPTURE_FILTER:
LT_SetAttributes(Handle,GAD_CONVERT_CHARS,
GA_Disabled, !Config -> CaptureConfig -> CaptureFilterMode,
TAG_DONE);
break;
case GAD_USE:
LT_UpdateStrings(Handle);
Config -> CaptureConfig -> OpenBufferWindow = OpenBufferWindow;
Config -> CaptureConfig -> OpenBufferScreen = OpenBufferScreen;
Config -> CaptureConfig -> BufferScreenMode = DisplayMode;
Done = TRUE;
break;
case GAD_CANCEL:
SaveConfig(PrivateConfig,Config);
Cancel = Done = TRUE;
break;
case GAD_DEFAULT:
*Default = TRUE;
Done = TRUE;
break;
case GAD_LOGFILE:
case GAD_CALL_LOGFILE:
FindPath(PanelWindow,LT_GetString(Handle,MsgGadget -> GadgetID),TRUE,NULL);
break;
case GAD_BUFFER_PATH:
case GAD_CAPTURE_PATH:
FindDrawer(PanelWindow,LT_GetString(Handle,MsgGadget -> GadgetID),TRUE,NULL);
break;
}
}
if(MsgClass == IDCMP_IDCMPUPDATE)
{
switch(MsgGadget -> GadgetID)
{
case GAD_LOGFILE:
LT_LockWindow(PanelWindow);
strcpy(DummyBuffer,(STRPTR)LT_GetAttributes(Handle,MsgGadget -> GadgetID,TAG_DONE));
if(DummyBuffer[0])
{
if(FilePart(DummyBuffer) == DummyBuffer)
DummyBuffer[0] = 0;
else
{
DummyChar = PathPart(DummyBuffer);
*DummyChar = 0;
}
DummyChar = FilePart((STRPTR)LT_GetAttributes(Handle,MsgGadget -> GadgetID,TAG_DONE));
}
else
DummyChar = "";
if(FileRequest = GetFile(PanelWindow,LocaleString(MSG_CAPTUREPANEL_SELECT_LOGFILE_TXT),DummyBuffer,DummyChar,DummyBuffer,NULL,FALSE,FALSE,FALSE,LocaleString(MSG_GLOBAL_SELECT_TXT),TRUE))
{
FindPath(PanelWindow,DummyBuffer,TRUE,NULL);
LT_SetAttributes(Handle,MsgGadget -> GadgetID,GTST_String,DummyBuffer,TAG_DONE);
FreeAslRequest(FileRequest);
}
LT_UnlockWindow(PanelWindow);
break;
case GAD_CALL_LOGFILE:
LT_LockWindow(PanelWindow);
strcpy(DummyBuffer,(STRPTR)LT_GetAttributes(Handle,MsgGadget -> GadgetID,TAG_DONE));
if(DummyBuffer[0])
{
if(FilePart(DummyBuffer) == DummyBuffer)
DummyBuffer[0] = 0;
else
{
DummyChar = PathPart(DummyBuffer);
*DummyChar = 0;
}
DummyChar = FilePart((STRPTR)LT_GetAttributes(Handle,MsgGadget -> GadgetID,TAG_DONE));
}
else
DummyChar = "";
if(FileRequest = GetFile(PanelWindow,LocaleString(MSG_CAPTUREPANEL_SELECT_CALL_LOGFILE_TXT),DummyBuffer,DummyChar,DummyBuffer,NULL,FALSE,FALSE,FALSE,LocaleString(MSG_GLOBAL_SELECT_TXT),TRUE))
{
FindPath(PanelWindow,DummyBuffer,TRUE,NULL);
LT_SetAttributes(Handle,MsgGadget -> GadgetID,GTST_String,DummyBuffer,TAG_DONE);
FreeAslRequest(FileRequest);
}
LT_UnlockWindow(PanelWindow);
break;
case GAD_BUFFER_PATH:
LT_LockWindow(PanelWindow);
strcpy(DummyBuffer,(STRPTR)LT_GetAttributes(Handle,MsgGadget -> GadgetID,TAG_DONE));
if(FileRequest = GetFile(PanelWindow,LocaleString(MSG_CAPTUREPANEL_SELECT_BUFFER_PATH_TXT),DummyBuffer,"",DummyBuffer,NULL,FALSE,FALSE,TRUE,LocaleString(MSG_GLOBAL_SELECT_TXT),TRUE))
{
FindDrawer(PanelWindow,DummyBuffer,TRUE,NULL);
LT_SetAttributes(Handle,MsgGadget -> GadgetID,GTST_String,DummyBuffer,TAG_DONE);
FreeAslRequest(FileRequest);
}
LT_UnlockWindow(PanelWindow);
break;
case GAD_CAPTURE_PATH:
LT_LockWindow(PanelWindow);
strcpy(DummyBuffer,(STRPTR)LT_GetAttributes(Handle,MsgGadget -> GadgetID,TAG_DONE));
if(FileRequest = GetFile(PanelWindow,LocaleString(MSG_CAPTUREPANEL_SELECT_CAPTURE_PATH_TXT),DummyBuffer,"",DummyBuffer,NULL,FALSE,FALSE,TRUE,LocaleString(MSG_GLOBAL_SELECT_TXT),TRUE))
{
FindDrawer(PanelWindow,DummyBuffer,TRUE,NULL);
LT_SetAttributes(Handle,MsgGadget -> GadgetID,GTST_String,DummyBuffer,TAG_DONE);
FreeAslRequest(FileRequest);
}
LT_UnlockWindow(PanelWindow);
break;
case GAD_SCREENMODE:
LT_LockWindow(PanelWindow);
if(SelectDisplayMode(PanelWindow,&DisplayMode,Config))
{
strcpy(ModeName,GetModeName(DisplayMode));
LT_SetAttributes(Handle,GAD_SCREENMODE,GTTX_Text,ModeName,TAG_DONE);
}
LT_UnlockWindow(PanelWindow);
LT_ShowWindow(Handle,TRUE);
break;
}
}
}
}
while(!Done);
PopWindow();
}
LT_DeleteHandle(Handle);
}
if(Default)
return((BYTE)(!Cancel));
else
return((BYTE)memcmp(PrivateConfig -> CaptureConfig,Config -> CaptureConfig,sizeof(struct CaptureSettings)));
}